home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Blender 2.49b / blender-2.49b-windows.exe / $_4_ / .blender / scripts / weightpaint_gradient.py < prev    next >
Text File  |  2009-08-31  |  2KB  |  60 lines

  1. #!BPY
  2. """
  3. Name: 'Weight Gradient...'
  4. Blender: 245
  5. Group: 'WeightPaint'
  6. Tooltip: 'Click on the start and end grad points for the mesh for selected faces.'
  7. """
  8.  
  9. __author__ = "Campbell Barton aka ideasman42"
  10. __url__ = ["www.blender.org", "blenderartists.org", "www.python.org"]
  11. __version__ = "0.1"
  12. __bpydoc__=\
  13. '''
  14. This script is used to fill the selected faces with a gradient
  15. To use the script, switch to "Face Select" mode then "Vertex Paint" mode
  16. Select the faces you wish to apply the gradient to.
  17. Click twice on the mesh to set the start and end points of the gradient.
  18. The color under the mouse will be used for the start and end blend colors.
  19. Note:
  20. Holding Shift or clicking outside the mesh on the second click will blend the first colour to nothing.    
  21. '''
  22.  
  23. # ***** BEGIN GPL LICENSE BLOCK *****
  24. #
  25. # This program is free software; you can redistribute it and/or
  26. # modify it under the terms of the GNU General Public License
  27. # as published by the Free Software Foundation; either version 2
  28. # of the License, or (at your option) any later version.
  29. #
  30. # This program is distributed in the hope that it will be useful,
  31. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  32. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  33. # GNU General Public License for more details.
  34. #
  35. # You should have received a copy of the GNU General Public License
  36. # along with this program; if not, write to the Free Software Foundation,
  37. # Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  38. #
  39. # ***** END GPL LICENCE BLOCK *****
  40.  
  41. import mesh_gradient
  42. import Blender
  43.  
  44. def main():
  45.     scn= Blender.Scene.GetCurrent()
  46.     ob= scn.objects.active
  47.     
  48.     if not ob or ob.type != 'Mesh':
  49.         Blender.Draw.PupMenu('Error, no active mesh object, aborting.')
  50.         return
  51.     # MODE 0 == VCOL
  52.     # MODE 1 == WEIGHT
  53.     MODE= 0
  54.     mesh_gradient.vertexGradientPick(ob, MODE)
  55.  
  56.  
  57. if __name__ == '__main__':
  58.     main()
  59.     
  60.